﻿/// <reference path="jquery-1.5.2-vsdoc.js" />
/// <reference path="PrinterArea.js" />

$(document).ready(function () {

    //alert("Hello");
    $("#Print").click(function () {
        var result = {};

        $.extend(result, $(".top"), $(".stamp"));

        result.printArea({ mode: "popup" });
        //$(".top").printArea({ mode: "popup" });
        //alert(("tr", $("." + "detail_table")).size());
        var x = getDataFromTable();
        var xx = x;
        alert("ddd");
    });
});


function getDataFromTable(options) {
    var defaults = {
        everyPage: 20,
        tableClass: "detail_table"
    };

    var settings = {}; //global settings
    $.extend(settings, defaults, options);
    var i = 0;
    var count = $("tbody tr", $("." + settings.tableClass)).size();
    var result = new Array();
    while (i * settings.everyPage<count) {

        var object = $("tbody tr", $("." + settings.tableClass)).filter(function (index) {
            return index > i * settings.everyPage && index < =((i + 1) * settings.everyPage)
        });

//        if () {
            result[i] = object;
//        }
//        else {
//            break;
//        }
        i++;
    }

    return result;

}

